package On_class.L0408;

import java.io.*;

public class FileReaderWriterTest1 {
    public static void main(String[] args) {
        BufferedReader br=null;
        BufferedWriter bw=null;
        try{
            br=new BufferedReader(new FileReader("copy.rar"));
            bw=new BufferedWriter(new FileWriter("D:\\copy1.rar"));
            String line;
            while ((line=br.readLine())!=null){
                bw.write(line);
                bw.newLine();
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if(bw!=null){
                try {
                    bw.close();
                }catch (IOException e){
                    e.printStackTrace();
                }
            }
            if(br!=null){
                try {
                    br.close();
                }catch (IOException e){
                    e.printStackTrace();
                }
            }
        }
    }
}
